import request from "@/utils/request";

// 查询垃圾分类列表
export function listBizRubbishType(query) {
  return request({
    url: "/biz/bizRubbishType/list",
    method: "get",
    params: query
  });
}

// 查询垃圾分类详细
export function getBizRubbishType(id) {
  return request({
    url: "/biz/bizRubbishType/" + id,
    method: "get"
  });
}
// 查询部门下拉树结构
export function findMaxSort(parentId) {
  return request({
    url: "/biz/bizRubbishType/findMaxSort/" + parentId,
    method: "get"
  });
}

// 新增垃圾分类
export function addBizRubbishType(data) {
  return request({
    url: "/biz/bizRubbishType",
    method: "post",
    data: data
  });
}

// 修改垃圾分类
export function updateBizRubbishType(data) {
  return request({
    url: "/biz/bizRubbishType",
    method: "put",
    data: data
  });
}

// 删除垃圾分类
export function delBizRubbishType(id) {
  return request({
    url: "/biz/bizRubbishType/" + id,
    method: "delete"
  });
}

// 导出垃圾分类
export function exportBizRubbishType(query) {
  return request({
    url: "/biz/bizRubbishType/export",
    method: "get",
    params: query
  });
}

export function listRubbishType(query, deptId, expandLevel) {
  if (deptId == null || deptId === "") {
    deptId = "0";
  }
  if (expandLevel == null || expandLevel === "") {
    expandLevel = "1";
  }
  return request({
    url: "/biz/bizRubbishType/list/" + expandLevel + "/" + deptId,
    method: "get",
    params: query
  });
}
export function listRubbishTypeTree(deptId, expandLevel) {
  if (deptId == null || deptId === "") {
    deptId = "0";
  }
  if (expandLevel == null || expandLevel === "") {
    expandLevel = "1";
  }
  return request({
    url: "/biz/bizRubbishType/listTree/" + expandLevel + "/" + deptId,
    method: "get"
  });
}
